package com.yc.blog.springmvc.freemarker.ctr;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

@Controller
public class DemoController1 {

	@RequestMapping("/c1-1")
	public ModelAndView c1() {
		System.out.println("--------c1---------");
		
		ModelAndView mv = new ModelAndView();
		
		mv.setViewName("page1.ftl");//指定页面
		
		mv.addObject("param1", "aaaaa");//绑定参数1
		
		return mv;
	}
	
	@RequestMapping("/c1-2")
	public ModelAndView c2() {
		System.out.println("--------c2---------");
		
		ModelAndView mv = new ModelAndView();
		
		mv.setViewName("page2.html");//指定页面
		
		mv.addObject("param1", "aaaaa");//绑定参数1
		
		return mv;
	}
	
	@RequestMapping("/c1-3")
	public ModelAndView c3() {
		System.out.println("--------c3---------");
		
		ModelAndView mv = new ModelAndView();
		
		mv.setViewName("page3.jsp");//指定页面
		
		mv.addObject("param1", "aaaaa");//绑定参数1
		
		return mv;
	}
}
